class_name JumpAbilitySpec
extends GameplayAbilitySpec


func _capture_targets() -> Array:
	return [ability.owner]


func _apply(target: Variant) -> void:
	var jump_height: float = target.attribute_manager.get_attribute("jump_height").current_value
	var jump_time_to_peak: float = target.attribute_manager.get_attribute("jump_time_to_peak").current_value
	var jump_speed: float = ((2.0 * jump_height) / jump_time_to_peak)
	target.velocity.y -= jump_speed
	end_ability()


func _on_update(_delta: float) -> void:
	pass


func _end_ability() -> void:
	pass
